jQuery(document).ready(function () {
    addPerCss();
    selectList();
});
function addPerCss() {
    var money = $("#money").val();
    var fundInSum = $("#fundInSum").val();
    var percent =  Math.floor(money / fundInSum * 100);
    var result = "";
    result += '<span style="width: '+percent+'%;" class="progress-bar progress-bar-success green-sharp"></span>'
    $("#perCss").append(result);
    $("#percent").append(percent+'%')
}
function changeOP(op){
    $("#op").val(op);
    selectList();
}
function queryParams(params) {
    var op =$("#op").val();
    params = $.extend({}, { op:op}, params);
    return getQueryParams(params, "searchForm");
}
function selectList() {
    $('#updItemTable').bootstrapTable("destroy");
    $('#updItemTable').bootstrapTable({
        method: "post",
        url: rootPath + "/fundManageCon/ajax/getItemList",
        showExport: true,
        exportTypes: ['excel'],//['json', 'xml', 'csv', 'txt', 'sql', 'excel'],
        Icons: 'glyphicon-export',
        exportOptions: {
            ignoreColumn: [0],  //忽略某一列的索引
            fileName: '金额变动列表',  //文件名称设置
            worksheetName: 'sheet1',  //表格工作区名称
            tableName: '金额变动列表'
        },
        exportDataType: 'all'
    });
}
function addFund() {
    layer.prompt({title:"请填入公司账户增加的资金金额(/元)：", formType: 3}, function(text, index){
        commonJs.ajaxRequest(rootPath+"/fundManageCon/ajax/addFund",{
            addMoney:text
        },function(data){
            if(data.code == '0000'){
                commonJs.alertMsg("操作成功",function(){
                    $("#updItemTable").bootstrapTable("refresh");
                    layer.close(index);
                })
            }else {
                layer.msg(data.msg);
            }
        })
    });
}